<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: gdsl_rbtree.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gdsl__rbtree_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">gdsl_rbtree.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gdsl__rbtree_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * This file is part of the Generic Data Structures Library (GDSL).</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2006 Nicolas Darnis &lt;ndarnis@free.fr&gt;.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * The GDSL library is free software; you can redistribute it and/or </span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License as </span>
<a name="l00007"></a>00007 <span class="comment"> * published by the Free Software Foundation; either version 2 of</span>
<a name="l00008"></a>00008 <span class="comment"> * the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * The GDSL library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with the GDSL library; see the file COPYING.</span>
<a name="l00017"></a>00017 <span class="comment"> * If not, write to the Free Software Foundation, Inc., </span>
<a name="l00018"></a>00018 <span class="comment"> * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * $RCSfile: gdsl__rbtree_8h_source.html,v $</span>
<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.3 $</span>
<a name="l00022"></a>00022 <span class="comment"> * $Date: 2013/06/12 16:36:13 $</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _GDSL_RBTREE_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _GDSL_RBTREE_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__types_8h.html">gdsl_types.h</a>&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="__gdsl__bintree_8h.html">_gdsl_bintree.h</a>&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__macros_8h.html">gdsl_macros.h</a>&quot;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> 
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 
<a name="l00052"></a><a class="code" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">00052</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>gdsl_rbtree* <a class="code" href="group__gdsl__rbtree.html#gab8c3c4319c7631622af23e39a7870c2b">gdsl_rbtree_t</a>;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 <span class="comment">/******************************************************************************/</span>
<a name="l00055"></a>00055 <span class="comment">/* Management functions of red-black trees                                    */</span>
<a name="l00056"></a>00056 <span class="comment">/******************************************************************************/</span>
<a name="l00057"></a>00057 
<a name="l00081"></a>00081 <span class="keyword">extern</span> gdsl_rbtree_t
<a name="l00082"></a>00082 <a class="code" href="group__gdsl__rbtree.html#gaced9f13fd9bd4cd9d9c27aeadffa35e7" title="Create a new red-black tree.">gdsl_rbtree_alloc</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* NAME,
<a name="l00083"></a>00083            <a class="code" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f" title="GDSL Alloc element function type.">gdsl_alloc_func_t</a> ALLOC_F,
<a name="l00084"></a>00084            <a class="code" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053" title="GDSL Free element function type.">gdsl_free_func_t</a> FREE_F,
<a name="l00085"></a>00085            <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F
<a name="l00086"></a>00086            );
<a name="l00087"></a>00087   
<a name="l00101"></a>00101 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00102"></a>00102 <a class="code" href="group__gdsl__rbtree.html#ga3740ac9553a92092fca0d0d7803404b7" title="Destroy a red-black tree.">gdsl_rbtree_free</a> (gdsl_rbtree_t T
<a name="l00103"></a>00103           );
<a name="l00104"></a>00104 
<a name="l00117"></a>00117 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00118"></a>00118 <a class="code" href="group__gdsl__rbtree.html#ga66fdc368ed633539d71f2a485d7c6052" title="Flush a red-black tree.">gdsl_rbtree_flush</a> (gdsl_rbtree_t T
<a name="l00119"></a>00119            );
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">/******************************************************************************/</span>
<a name="l00122"></a>00122 <span class="comment">/* Consultation functions of red-black trees                                  */</span>
<a name="l00123"></a>00123 <span class="comment">/******************************************************************************/</span>
<a name="l00124"></a>00124 
<a name="l00134"></a>00134 <span class="keyword">extern</span> <span class="keywordtype">char</span>*
<a name="l00135"></a>00135 <a class="code" href="group__gdsl__rbtree.html#ga2e908aaf5ea816b4cf5acbcb5ba4011e" title="Get the name of a red-black tree.">gdsl_rbtree_get_name</a> (<span class="keyword">const</span> gdsl_rbtree_t T
<a name="l00136"></a>00136               );
<a name="l00137"></a>00137 
<a name="l00146"></a>00146 <span class="keyword">extern</span> <span class="keywordtype">bool</span>
<a name="l00147"></a>00147 <a class="code" href="group__gdsl__rbtree.html#ga2d21a1abf59af6b8db454ec4ddab4cb9" title="Check if a red-black tree is empty.">gdsl_rbtree_is_empty</a> (<span class="keyword">const</span> gdsl_rbtree_t T
<a name="l00148"></a>00148               );
<a name="l00149"></a>00149 
<a name="l00157"></a>00157 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00158"></a>00158 <a class="code" href="group__gdsl__rbtree.html#ga260cf7c8c18241ba83e115cbd2f34c32" title="Get the root of a red-black tree.">gdsl_rbtree_get_root</a> (<span class="keyword">const</span> gdsl_rbtree_t T
<a name="l00159"></a>00159               );
<a name="l00160"></a>00160 
<a name="l00169"></a>00169 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00170"></a>00170 <a class="code" href="group__gdsl__rbtree.html#gaa444fc6695317a905c6c22715e163c2b" title="Get the size of a red-black tree.">gdsl_rbtree_get_size</a> (<span class="keyword">const</span> gdsl_rbtree_t T
<a name="l00171"></a>00171               );
<a name="l00172"></a>00172 
<a name="l00181"></a>00181 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00182"></a>00182 <a class="code" href="group__gdsl__rbtree.html#ga875c222e6575fd1ce17c58a30f5c693a" title="Get the height of a red-black tree.">gdsl_rbtree_height</a> (<span class="keyword">const</span> gdsl_rbtree_t T
<a name="l00183"></a>00183             );
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="comment">/******************************************************************************/</span>
<a name="l00186"></a>00186 <span class="comment">/* Modification functions of red-black trees                                  */</span>
<a name="l00187"></a>00187 <span class="comment">/******************************************************************************/</span>
<a name="l00188"></a>00188 
<a name="l00202"></a>00202 <span class="keyword">extern</span> gdsl_rbtree_t
<a name="l00203"></a>00203 <a class="code" href="group__gdsl__rbtree.html#ga088daaa858f351d7d18d9501a12b30e3" title="Set the name of a red-black tree.">gdsl_rbtree_set_name</a> (gdsl_rbtree_t T,
<a name="l00204"></a>00204               <span class="keyword">const</span> <span class="keywordtype">char</span>* NEW_NAME
<a name="l00205"></a>00205               );
<a name="l00206"></a>00206 
<a name="l00229"></a>00229 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00230"></a>00230 <a class="code" href="group__gdsl__rbtree.html#ga37088d5953e6800d9276a6286bf12521" title="Insert an element into a red-black tree if it&#39;s not found or return it.">gdsl_rbtree_insert</a> (gdsl_rbtree_t T,
<a name="l00231"></a>00231             <span class="keywordtype">void</span>* VALUE,
<a name="l00232"></a>00232             <span class="keywordtype">int</span>* RESULT
<a name="l00233"></a>00233             );
<a name="l00234"></a>00234 
<a name="l00251"></a>00251 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00252"></a>00252 <a class="code" href="group__gdsl__rbtree.html#gaa9d34dd8149e458dc0306cd6caabf516" title="Remove an element from a red-black tree.">gdsl_rbtree_remove</a> (gdsl_rbtree_t T,
<a name="l00253"></a>00253             <span class="keywordtype">void</span>* VALUE
<a name="l00254"></a>00254             );
<a name="l00255"></a>00255 
<a name="l00273"></a>00273 <span class="keyword">extern</span> gdsl_rbtree_t
<a name="l00274"></a>00274 <a class="code" href="group__gdsl__rbtree.html#ga1f9cfaf592b74449a103d550c0c05eb5" title="Delete an element from a red-black tree.">gdsl_rbtree_delete</a> (gdsl_rbtree_t T,
<a name="l00275"></a>00275             <span class="keywordtype">void</span>* VALUE
<a name="l00276"></a>00276             );
<a name="l00277"></a>00277 
<a name="l00278"></a>00278 <span class="comment">/******************************************************************************/</span>
<a name="l00279"></a>00279 <span class="comment">/* Search functions of red-black trees                                        */</span>
<a name="l00280"></a>00280 <span class="comment">/******************************************************************************/</span>
<a name="l00281"></a>00281 
<a name="l00301"></a>00301 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00302"></a>00302 <a class="code" href="group__gdsl__rbtree.html#gacb481b6b1bbcfc424897d5e1056516b7" title="Search for a particular element into a red-black tree.">gdsl_rbtree_search</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00303"></a>00303             <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F,
<a name="l00304"></a>00304             <span class="keywordtype">void</span>* VALUE
<a name="l00305"></a>00305             );
<a name="l00306"></a>00306 
<a name="l00307"></a>00307 <span class="comment">/******************************************************************************/</span>
<a name="l00308"></a>00308 <span class="comment">/* Parse functions of red-black trees                                         */</span>
<a name="l00309"></a>00309 <span class="comment">/******************************************************************************/</span>
<a name="l00310"></a>00310 
<a name="l00329"></a>00329 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00330"></a>00330 <a class="code" href="group__gdsl__rbtree.html#gae2908f10ff9e46db4693a051adcb5fa3" title="Parse a red-black tree in prefixed order.">gdsl_rbtree_map_prefix</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00331"></a>00331             <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00332"></a>00332             <span class="keywordtype">void</span>* USER_DATA
<a name="l00333"></a>00333             );
<a name="l00334"></a>00334 
<a name="l00353"></a>00353 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00354"></a>00354 <a class="code" href="group__gdsl__rbtree.html#ga4a4cd2c7801ab55e6d0913bb94b44a3b" title="Parse a red-black tree in infixed order.">gdsl_rbtree_map_infix</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00355"></a>00355                <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00356"></a>00356                <span class="keywordtype">void</span>* USER_DATA
<a name="l00357"></a>00357                );
<a name="l00358"></a>00358 
<a name="l00377"></a>00377 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00378"></a>00378 <a class="code" href="group__gdsl__rbtree.html#gaf94da0ad1d02db0f9c10e9f5a95d28ae" title="Parse a red-black tree in postfixed order.">gdsl_rbtree_map_postfix</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00379"></a>00379              <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00380"></a>00380              <span class="keywordtype">void</span>* USER_DATA
<a name="l00381"></a>00381              );
<a name="l00382"></a>00382 
<a name="l00383"></a>00383 <span class="comment">/******************************************************************************/</span>
<a name="l00384"></a>00384 <span class="comment">/* Input/output functions of red-black trees                                  */</span>
<a name="l00385"></a>00385 <span class="comment">/******************************************************************************/</span>
<a name="l00386"></a>00386 
<a name="l00403"></a>00403 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00404"></a>00404 <a class="code" href="group__gdsl__rbtree.html#ga2fd7ef2dc1fc59e0c8442b8fc98cdbc9" title="Write the element of each node of a red-black tree to a file.">gdsl_rbtree_write</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00405"></a>00405            <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00406"></a>00406            FILE* OUTPUT_FILE,
<a name="l00407"></a>00407            <span class="keywordtype">void</span>* USER_DATA
<a name="l00408"></a>00408            );
<a name="l00409"></a>00409 
<a name="l00428"></a>00428 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00429"></a>00429 <a class="code" href="group__gdsl__rbtree.html#gadf28f012b77d91409e2a4c0de0498bc7" title="Write the content of a red-black tree to a file into XML.">gdsl_rbtree_write_xml</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00430"></a>00430                <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00431"></a>00431                FILE* OUTPUT_FILE,
<a name="l00432"></a>00432                <span class="keywordtype">void</span>* USER_DATA
<a name="l00433"></a>00433                );
<a name="l00434"></a>00434 
<a name="l00452"></a>00452 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00453"></a>00453 <a class="code" href="group__gdsl__rbtree.html#ga410a6b15d94f9b5a6cf834716893e911" title="Dump the internal structure of a red-black tree to a file.">gdsl_rbtree_dump</a> (<span class="keyword">const</span> gdsl_rbtree_t T,
<a name="l00454"></a>00454           <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00455"></a>00455           FILE* OUTPUT_FILE,
<a name="l00456"></a>00456           <span class="keywordtype">void</span>* USER_DATA
<a name="l00457"></a>00457           );
<a name="l00458"></a>00458 
<a name="l00459"></a>00459 <span class="comment">/*</span>
<a name="l00460"></a>00460 <span class="comment"> * @}</span>
<a name="l00461"></a>00461 <span class="comment"> */</span>
<a name="l00462"></a>00462 
<a name="l00463"></a>00463 
<a name="l00464"></a>00464 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00465"></a>00465 <span class="preprocessor"></span>}
<a name="l00466"></a>00466 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00467"></a>00467 
<a name="l00468"></a>00468 
<a name="l00469"></a>00469 <span class="preprocessor">#endif </span><span class="comment">/* _GDSL_RBTREE_H_ */</span>
<a name="l00470"></a>00470 
<a name="l00471"></a>00471 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gdsl__rbtree_8h.html">gdsl_rbtree.h</a>      </li>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
